<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>访问当当购物车页面节点</title>
		<link type="text/css" rel="stylesheet" href="css/cartStyle.css" />
	</head>
	<body>

		<div class="content">
			<div class="logo">
				<img src="images/dd_logo.jpg"><span onclick="close_plan();">关闭</span>
			</div>
			<div class="cartList" id="cartList">
				<ul>
					<li>¥<input type="text" name="price" value="21.90"></li>
					<li><input type="button" name="minus" value="-" onclick="minus(this);"><input type="text"
							name="amount" value="1"><input type="button" name="plus" value="+" onclick="plus(this);">
					</li>
					<li id="price0">¥21.90</li>
					<li>
						<p onclick="collection();">移入收藏</p>
						<p onclick="del();">删除</p>
					</li>
				</ul>
				<ul>
					<li>¥<input type="text" name="price" value="24.00"></li>
					<li><input type="button" name="minus" value="-" onclick="minus(this);"><input type="text"
							name="amount" value="1"><input type="button" name="plus" value="+" onclick="plus(this);">
					</li>
					<li id="price1">¥24.00</li>
					<li>
						<p onclick="collection();">移入收藏</p>
						<p onclick="del();">删除</p>
					</li>
				</ul>
				<ol>
					<li id="totalPrice">&nbsp;</li>
					<li><span onclick="accounts();">结 算</span></li>
				</ol>
			</div>
			<div></div>
		</div>
		<script>
			function minus(t) {
				var s = t.nextElementSibling;
				if (s.value > 0) {
					s.value--;
				}
				var price = t.parentNode.previousElementSibling.lastElementChild.value;
				// alert(price)
				t.parentNode.nextElementSibling.innerHTML = ("￥" + parseInt(Math.round(price * s.value*100))/100);
			}

			function plus(r) {
				var q = r.previousElementSibling;
				q.value++;
				var price = r.parentNode.previousElementSibling.lastElementChild.value;
				r.parentNode.nextElementSibling.innerHTML = ("￥" + parseInt(Math.round(price * q.value*100))/100);
			}
		</script>
	</body>
</html>
